<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class SettingWechat extends Model
{
    use HasFactory;
    public $timestamps = false;
    protected $fillable = [
        'wechat_name',
        'wechat_appid',
        'wechat_secret',
        'wechat_token',
        'wechat_encoding_key',
        'wechat_logo',
        'wechat_qrcode'
    ];
    protected $appends = ['communication_url'];

    protected $casts = ['wechat_navs'=>'array'];

    /**
     * 微信通讯地址
     */
    public function getCommunicationUrlAttribute()
    {
        return config('app.url').'/wechat';
    }
}
